package sys.service.impl;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import sys.dao.TbUserDao;
import sys.entity.*;
import sys.service.TbUserService;
import sys.utils.PageUtil;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@Service
public class TbUserServiceImpl implements TbUserService {


	private final TbUserDao dao;



	@Autowired
	public TbUserServiceImpl(TbUserDao dao) {
		this.dao = dao;
	}

	@Override
	public void add(TbUserEntity entity) {
		dao.add(entity);
	}

	@Override
	public void delete(TbUserEntity entity) {
		dao.delete(entity);
	}

	@Override
	public void update(TbUserEntity entity) {
		dao.update(entity);
	}

	@Override
	public List<TbUserEntity> select(TbUserEntity entity) {
		return dao.select(entity);
	}

	@Override
	public PageData<TbUserEntity> likeSelect(TbUserEntity entity) {
		return PageUtil.getPageData(entity, dao);
	}

	@Override
	public void exportExcel(TbUserEntity entity, HttpServletResponse response) {
	}



	@Override
	public TbUserEntity login(User user) {
		return dao.login(user.getUserName(),user.getPassword());
	}
}
